import upload from '@/utils/upload'
import request from '@/utils/request'

// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
	const data = {
		oldPassword,
		newPassword
	}
	return request({
		url: '/system/user/profile/updatePwd',
		method: 'put',
		params: data
	})
}

// 查询用户个人信息
export function getUserProfile(data) {
	return request({
		url: '/member/mine',
		method: 'get',
		data: data
	})
}


// 修改用户个人信息
export function updateUserProfile(data) {
	return request({
		url: '/member/renew',
		method: 'post',
		data: data
	})
}

// 用户头像上传
export function uploadAvatar(data) {
	return upload({
		url: '/member/upload',
		name: data.name,
		filePath: data.filePath
	})
}


// 获取验证码
export function getcodeSms(data) {
	return request({
		url: '/member/sms',
		method: 'post',
		data: data
	})
}


// 手机号绑定
export function getBindMobile(data) {
	return request({
		url: '/member/bindMobile',
		method: 'post',
		data: data
	})
}

export function logout() {
	return request({
		url: '/member/logout',
		method: 'get',

	})
}

//绑定微信
export function wechatBind(data) {
	return request({
		url: '/member/wechatBind',
		method: 'post',
		data: data
	})
}

//解绑微信
export function wechatBindOut() {
	return request({
		url: '/member/wechatBindOut',
		method: 'get',
	})
}

// 用户头像上传
export function uploadWork(data) {
	return upload({
		url: '/member/upload',
		name: data.name,
		filePath: data.filePath
	})
}